package com.ruoyi.checksystem.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.checksystem.mapper.FileUploadMapper;
import com.ruoyi.checksystem.domain.FileUpload;
import com.ruoyi.checksystem.service.IFileUploadService;

/**
 * 文件上传Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Service
public class FileUploadServiceImpl implements IFileUploadService 
{
    @Autowired
    private FileUploadMapper fileUploadMapper;

    /**
     * 查询文件上传
     * 
     * @param id 文件上传主键
     * @return 文件上传
     */
    @Override
    public FileUpload selectFileUploadById(Long id)
    {
        return fileUploadMapper.selectFileUploadById(id);
    }

    /**
     * 查询文件上传列表
     * 
     * @param fileUpload 文件上传
     * @return 文件上传
     */
    @Override
    public List<FileUpload> selectFileUploadList(FileUpload fileUpload)
    {
        return fileUploadMapper.selectFileUploadList(fileUpload);
    }

    /**
     * 新增文件上传
     * 
     * @param fileUpload 文件上传
     * @return 结果
     */
    @Override
    public int insertFileUpload(FileUpload fileUpload)
    {
        fileUpload.setCreateTime(DateUtils.getNowDate());
        return fileUploadMapper.insertFileUpload(fileUpload);
    }

    /**
     * 修改文件上传
     * 
     * @param fileUpload 文件上传
     * @return 结果
     */
    @Override
    public int updateFileUpload(FileUpload fileUpload)
    {
        fileUpload.setUpdateTime(DateUtils.getNowDate());
        return fileUploadMapper.updateFileUpload(fileUpload);
    }

    /**
     * 批量删除文件上传
     * 
     * @param ids 需要删除的文件上传主键
     * @return 结果
     */
    @Override
    public int deleteFileUploadByIds(Long[] ids)
    {
        return fileUploadMapper.deleteFileUploadByIds(ids);
    }

    /**
     * 删除文件上传信息
     * 
     * @param id 文件上传主键
     * @return 结果
     */
    @Override
    public int deleteFileUploadById(Long id)
    {
        return fileUploadMapper.deleteFileUploadById(id);
    }
}
